<!DOCTYPE html>


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>值班</title>
</head>

<span id="clock"><span> 
 <body>
<script type="text/javascript">
  
  function clock(){
  var time=new Date();
 
  var week;
  var db;
  var n = 0 ;
  var k;
 
  
   function fun_date(aa){
        var date1 = new Date(),
        time1=date1.getFullYear()+"-"+(date1.getMonth()+1)+"-"+date1.getDate();//time1表示当前时间
        var date2 = new Date(date1);
        date2.setDate(date1.getDate()+aa);
        var time2 = date2.getFullYear()+"-"+(date2.getMonth()+1)+"-"+date2.getDate();
        return time2;
    }
    //fun_date(7);//7天后的日期
    //fun_date(-7);//7天前的日期
  
 
  switch (time.getDay()){
    case 1: week="周一"+" "+"制作运维：沈玥婷 电话：666570"; k=1;break;
    case 2: week="周二"+" "+"制作运维：杨  辰 电话：660162"; k=2;break;
    case 3: week="周三"+" "+"制作运维：沈玥婷 电话：666570"; k=3;break;
    case 4: week="周四"+" "+"制作运维：周冰杰 电话：663326"; k=4;break;
    case 5: week="周五";k=5;
		                  if(time.getHours() >= 0 && time.getHours() <=16 )week="周五"+"上午班，制作运维：杨  辰 电话：660162"; 
	                    else   week="周五"+"下午班，制作运维：周冰杰 电话：663326";break;
    case 6: week="周六1";k=6;
		                  if(time.getHours() >= 0 && time.getHours() <=15 )week="周六"+"上午班，制作运维：周冰杰 电话：663326"; 
	                    else   week="周六"+"下午班，制作运维：杨  辰 电话：660162";break;
	
	default: week="周日";k=0;
	

	   //var date1=new Date(2020,9,4,0,0,0); //需要的月份-1
       //var date2=new Date(); 
       //var date3=date2.getTime()-date1.getTime();
       //var days=Math.floor(date3/(24*3600*1000));
	   //var js=days/7
	   //var n=js%3
       n=cn(7);

	   //if(n==0) db="制作运维：周冰杰 电话：663326";
	      //else if (n==2) db="制作运维：沈玥婷 电话：666570";
	         //else db="制作运维：杨  辰 电话：660162";
       db=on_duty7(n);



  }
  	var year=time.getFullYear();
	var month=time.getMonth();
	var date=time.getDate();
	var se =time.getSeconds();
	var next;
  
  
  function on_duty7(bb){
	   if(bb==0) db="周冰杰 电话：663326";
	      else if (bb==2) db="沈玥婷 电话：666570";
	         else db="杨  辰 电话：660162";
  return db
  }
  
  function next_duty7(cc){
	if(cc==0) next="杨  辰 电话：660162";
	else if (cc==2)next="周冰杰 电话：663326";
	     else next="沈玥婷 电话：666570";
  return next
  }
  
  function cn(dd){
  
  	   var date1=new Date(2020,9,4,0,0,0); //需要的月份-1
       var date2=new Date(); 
       var date3=date2.getTime()-date1.getTime();
       var days=Math.floor(date3/(24*3600*1000));
	   var js=(days-dd+7)/7
	   var n1=js%3
  
      return n1
  }
	
	if(k==0)
       { document.getElementById("clock").innerHTML = "今天是："+year+"年"+(month+1)+"月"+date+"日  "+time.getHours()+":" +time.getMinutes()+":"+time.getSeconds()+"<br>"+week + " "+"制作运维："+db+" "+"<br>"+"本周日："+fun_date(0)+" "+on_duty7(n)+"<br>"+"下周日："+fun_date(7)+" "+next_duty7(n)+"<br>"+ "v1.3";
	
	document.getElementById("footyear").innerHTML = year;}
	else
	
	{ 
	
	document.getElementById("clock").innerHTML = "今天是："+year+"年"+(month+1)+"月"+date+"日  "+time.getHours()+":" +time.getMinutes()+":"+time.getSeconds()+"<br>"+week+"<br>"+" "+"本周日："+fun_date(7-k)+" "+on_duty7(cn(k))+"<br>"+"下周日："+fun_date(14-k)+" "+next_duty7(cn(k))+"<br>" + "v1.3";
	
	document.getElementById("footyear").innerHTML = year;}
	
	
  }
  setInterval(clock,1000); 
  
</script>

 </body>
</html>